/* eslint valid-jsdoc: "off" */

'use strict';
const path = require('path');

/**
 * @param {Egg.EggAppInfo} app app info
 */
module.exports = app => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // 保证构建的静态资源文件能够被访问到
  config.static = { prefix: '/public/', dir: path.join(app.baseDir, 'public') };

  config.vuessr = {
    layout: path.join(app.baseDir, 'app/web/view/layout.html'),
    renderOptions: {
      basedir: path.join(app.baseDir, 'app/view')
    }
  };

  // use for cookie sign key, should change to your own and keep security
  config.keys = app.name + '_1593231267426_5089';

  // add your middleware config here
  config.middleware = [];

  // mongodb 配置
  // config.mongoose = {
  //   url: 'mongodb://127.0.0.1/tuku',
  //   options: {
  //     useUnifiedTopology: true,
  //     useCreateIndex: true,
  //     useNewUrlParser: true,
  //   }
  // };

  // add your user config here
  const userConfig = {
    title: '图酷后台管理系统',
  };

  return {
    ...config,
    ...userConfig,
  };
};
